package com.cn.jx.manager.po;

import com.cn.jx.common.entity.BaseIdEntity;

import static com.jx.util.CodeUtil.getRandomId;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="SYS_MESSAGE")
public class Message extends BaseIdEntity {

	/** <p>TODO <p>{@link long serialVersionUID}*/
	private static final long serialVersionUID = -3979197619040933492L;

	@Column(name="mail_title",length=100)
	private String title;
	
	@Column(name="mail_type",length=32)
	private String type;
	
	@Column(name="mail_content",length=800)
	private String content;
	
	/** <p>创建时间  <p>数据创建的时候的时间<p>设置为{@link Date 时间}类型*/
	@Temporal(TemporalType.TIMESTAMP)//设置为时间类型
	@Column(name="create_time")
	private Date createTime;
	

	public static Message getInstance(){
		Date day=new Date();
		Message m=new Message();
		m.setId(getRandomId());
		m.setCreateTime(day);
		return m;
	}
	
	/** <p>{@link String String getTitle()*/
	public String getTitle() {
		return title;
	}

	/** <p>setTitle({@link String String title})*/
	public void setTitle(String title) {
		this.title = title;
	}

	/** <p>{@link String String getContent()*/
	public String getContent() {
		return content;
	}

	/** <p>setContent({@link String String content})*/
	public void setContent(String content) {
		this.content = content;
	}


	/** <p>{@link String String getType()*/
	public String getType() {
		return type;
	}

	/** <p>setType({@link String String type})*/
	public void setType(String type) {
		this.type = type;
	}

	/** <p>{@link Date Date getCreateTime()*/
	public Date getCreateTime() {
		return createTime;
	}

	/** <p>setCreateTime({@link Date Date createTime})*/
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

}
